package com.supporter.sysbench;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author xunaidong
 * @date 2021/8/8
 */
@Component
@ConfigurationProperties(prefix = "sysbench")
public class GlobalProperties {
    private int threads = 20;
    private int tableNumber = 200;
    private int tableData = 50000;
    private int duration = 600;
    private Command command;
    private Data data;
    private long reportInterval;

    public Command getCommand() {
        return command;
    }

    public void setCommand(Command command) {
        this.command = command;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    public int getThreads() {
        return threads;
    }

    public long getReportInterval() {
        return reportInterval;
    }

    public void setReportInterval(long reportInterval) {
        this.reportInterval = reportInterval;
    }

    public void setThreads(int threads) {
        this.threads = threads;
    }

    public int getTableNumber() {
        return tableNumber;
    }

    public void setTableNumber(int tableNumber) {
        this.tableNumber = tableNumber;
    }

    public int getTableData() {
        return tableData;
    }

    public void setTableData(int tableData) {
        this.tableData = tableData;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public static class Data {
        private String username;
        private String password;
        private String driverClassName;
        private String jdbcUrl;
        private String dsName;
        private int connTimeout;

        public String getDsName() {
            return dsName;
        }

        public void setDsName(String dsName) {
            this.dsName = dsName;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getJdbcUrl() {
            return jdbcUrl;
        }

        public void setJdbcUrl(String jdbcUrl) {
            this.jdbcUrl = jdbcUrl;
        }

        public int getConnTimeout() {
            return connTimeout;
        }

        public void setConnTimeout(int connTimeout) {
            this.connTimeout = connTimeout;
        }

        public String getDriverClassName() {
            return driverClassName;
        }

        public void setDriverClassName(String driverClassName) {
            this.driverClassName = driverClassName;
        }
    }
}
